package com.book.oauth.server.project.hystrix.impl;

import com.book.common.api.impl.BaseHystrixImpl;
import com.book.oauth.server.project.dto.ProjectDto;
import com.book.oauth.server.project.vo.ProjectVo;
import com.book.oauth.server.project.hystrix.IProjectHystrix;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * Description：项目（如公司里某个项目） HystrixImpl
 * @Author： leo
 * @CreateDate： 2020-12-31
 * @Email： leo.xiong@suyun360.com
 * Version: 1.0
 */
@Slf4j
@Component
public class ProjectHystrixImpl extends BaseHystrixImpl<ProjectDto, ProjectVo> implements FallbackFactory<IProjectHystrix>, IProjectHystrix {

    @Override
    public IProjectHystrix create(Throwable e) {
        log.error("oauth-server.ProjectHystrixImpl.项目（如公司里某个项目）服务调用失败:{}", e.getMessage());
        e.printStackTrace();
        return new ProjectHystrixImpl();
    }
}
